package org.jetnuke.dao.hsqldb;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;

import net.jforum.JForumExecutionContext;
import net.jforum.util.preferences.SystemGlobals;

import org.jetnuke.dao.PictureDAO;
import org.jetnuke.dao.generic.GenericPictureDAO;

public class HsqldbPictureDAO extends GenericPictureDAO implements PictureDAO {

	public List search(String searchval, int start, int limit) throws Exception {
		PreparedStatement p= JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PictureModel.search"));
		String val="%"+searchval+"%";
		p.setInt(1,start);
		p.setInt(2,limit);
		p.setString(3,val);
		p.setString(4,val);
		p.setString(5,val);
		p.setString(6,val);
		ResultSet rs = p.executeQuery();
		List list = this.processSelectAll(rs);
		rs.close();
		p.close();
		
		return list;
	}

}
